package mybatis.mapping;

/**
 * 映射关系类
 *
 * @author richie696
 * @version 1.0
 * @since 2020/11/07
 */
public class MappedStatement {

    /**
     * 语句ID
     */
    private String id;

    /**
     * 结果类型描述
     */
    private String resultType;

    /**
     * 返回结果类类型
     */
    private Class<?> resultTypeClass;
    /**
     * 入参类型描述
     */
    private String parameterType;

    /**
     * SQL语句
     */
    private String sql;
    /**
     * 是否生成主键
     */
    private boolean useGeneratedKeys = false;
    /**
     * 主键字段
     */
    private String keyProperty;
    /**
     * SQL命令类型
     */
    private SqlCommandType sqlCommandType;

    public MappedStatement() {
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getResultType() {
        return resultType;
    }

    public void setResultType(String resultType) {
        this.resultType = resultType;
    }

    public String getParameterType() {
        return parameterType;
    }

    public void setParameterType(String parameterType) {
        this.parameterType = parameterType;
    }

    public String getSql() {
        return sql;
    }

    public void setSql(String sql) {
        this.sql = sql;
    }

    public boolean isUseGeneratedKeys() {
        return useGeneratedKeys;
    }

    public void setUseGeneratedKeys(boolean useGeneratedKeys) {
        this.useGeneratedKeys = useGeneratedKeys;
    }

    public String getKeyProperty() {
        return keyProperty;
    }

    public void setKeyProperty(String keyProperty) {
        this.keyProperty = keyProperty;
    }

    public Class<?> getResultTypeClass() {
        return resultTypeClass;
    }

    public void setResultTypeClass(Class<?> resultTypeClass) {
        this.resultTypeClass = resultTypeClass;
    }

    public SqlCommandType getSqlCommandType() {
        return sqlCommandType;
    }

    public MappedStatement setSqlCommandType(SqlCommandType sqlCommandType) {
        this.sqlCommandType = sqlCommandType;
        return this;
    }
}
